import request from "@/utils/request";

//获取角色信息列表
export function getRoleList(params){
  return request({
    url:'/sys/role',
    method:'get',
    params
  })
}

//获取公司信息
export function getCompanyInfo(companyId){
  return request({
    url: `/company/${companyId}`,
    method:'get'
  })
}

//删除角色
export function deleteRole(id){
  return request({
    url:`/sys/role/${id}`,
    method:'delete'
  })

}

//编辑角色
export function updateRole(data){
  return request({
    url: `/sys/role/${data.id}`,
    method:'put',
    data
  })
}
//获取角色详情，跟上面的简单信息不一样
export function getRoleDetail(id){
  return request({

    url:`/sys/role/${id}`,
    method:'get'

  })
}


//新增角色
export function addRole(data) {
  return request({
    url: '/sys/role',
    data,
    method: 'post'
  })
}
